﻿using Client.Framework.Message;
using Client.Model;
using Google.Protobuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client.Message.Request
{
    class AllotPerReq : RequestBaseMessage
    {
        public AllotPerReq(int msgId) : base(msgId)
        {

        }

        public int RoleId { get; set; }

        public List<AllotMenu> AllotMenuList { get; } = new List<AllotMenu>();

        public override byte[] Serialize()
        {
            RequestAllotPermission msg = new RequestAllotPermission
            {
                RoleId = RoleId
            };
            AllotMenuList.ForEach(obj =>
            {
                msg.AllotMenus.Add(obj);
            });
            return msg.ToByteArray();
        }
    }
}
